package com.example;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @ClassName Invocation
 * @Description
 * @Author Yin
 * @Date 2021/4/11 23:13
 * @Version 1.0
 */
public class Invocation {
    private Object[] params;
    private Method method;
    private Object target;


    public Invocation(Object[] params, Method method, Object target) {
        this.params = params;
        this.method = method;
        this.target = target;
    }

    public Object proceed() throws InvocationTargetException, IllegalAccessException {
        return method.invoke(target,params);
    }
}
